# Replication archive for: Alexander Coppock, Kimberly Gross, Ethan Porter, Emily Thorson, and Thomas J. Wood, 
# "Conceptual Replication of Four Key Findings about Factual Corrections and Misinformation during the 2020 US Election: Evidence from Panel-Survey Experiments." 
# Forthcoming in the British Journal of Political Science doi:10.1017/S0007123422000631

library(tidyverse)
library(estimatr)
library(metafor)
library(broom)

source("code/helpers.R")

covariates <-
  "+ lucid_pid_7n +
  lucid_age +
  lucid_race +
  lucid_hhin +
  political_knowledge_pre +
  political_interest_pre +
  cognitive_reflection_pre +
  need_for_cognition_pre +
  extraversion_pre +
  agreeableness_pre +
  conscientiousness_pre +
  emotional_stability_pre +
  openness_to_experience_pre"


covariates_no_pid <-
  "lucid_age +
  lucid_race +
  lucid_hhin +
  political_knowledge_pre +
  political_interest_pre +
  cognitive_reflection_pre +
  need_for_cognition_pre +
  extraversion_pre +
  agreeableness_pre +
  conscientiousness_pre +
  emotional_stability_pre +
  openness_to_experience_pre"

# prepare subsets ---------------------------------------------------------

all_panels_long <- read_rds("data/all_panels_long.rds")
treatments_df <- read_rds("data/treatments_df.rds")

persistence_p2_df <-
  all_panels_long %>%
  filter(!is.na(outcome_w1),
         !is.na(outcome_w2),
         treatment != "misinformation")

persistence_p3_df <-
  all_panels_long %>%
  filter(!is.na(outcome_w1),
         !is.na(outcome_w3),
         treatment != "misinformation")


filter_and_flip <- function(data) {
  data %>%
    filter(term %in% c("treatmentcontrol", "treatmentfactcheck")) %>%
    mutate(
      estimate = if_else(term == "treatmentcontrol",-1 * estimate, estimate),
      conf.low = if_else(term == "treatmentcontrol",-1 * conf.low, conf.low),
      conf.high = if_else(term == "treatmentcontrol",-1 * conf.high, conf.high),
    )
  
}



# Average Treatment Effects at Wave 1 -------------------------------------

ates_w1_all_noadj <-
  all_panels_long %>%
  group_by(fc, panel, panel_factor, rating) %>%
  do(tidy(lm_robust(formula(
    outcome_w1 ~ treatment
  ), data = .))) %>%
  filter_and_flip

ates_w1_all_adj <-
  all_panels_long %>%
  group_by(fc, panel, panel_factor, rating) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w1 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip

# Cates -----------------------------------------------------

cates_w1_all_noadj <-
  all_panels_long %>%
  filter(lucid_pid_3 != "Independent") %>%
  group_by(fc, panel, panel_factor, lucid_pid_3) %>%
  do(tidy(lm_robust(formula(
    outcome_w1 ~ treatment
  ), data = .))) %>%
  filter_and_flip


cates_w1_all_adj <-
  all_panels_long %>%
  filter(lucid_pid_3 != "Independent") %>%
  group_by(fc, panel, panel_factor, lucid_pid_3) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w1 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip

diff_in_cates_w1_all_adj <-
  all_panels_long %>%
  filter(lucid_pid_3 != "Independent") %>%
  group_by(fc, panel, topic_short_2) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w1 ~ treatment + lucid_pid_3 + lucid_pid_3*treatment + lucid_pid_3*(", covariates, ")")
  ), data = .))) %>% 
  filter(
    term %in% 
      c("treatmentcontrol:lucid_pid_3Republican",
        "treatmentfactcheck:lucid_pid_3Republican")
    ) %>% 
  ungroup


write_rds(diff_in_cates_w1_all_adj, 
          file = "fitted_models/diff_in_cates_w1_all_adj.rds")



trait_cates_w1_all_noadj <-
  all_panels_long %>%
  pivot_longer(
    cols = c(
      grp_crt,
      grp_polint,
      grp_nfc,
      grp_openness,
      grp_conscientiousness,
      grp_extraversion,
      grp_agree,
      grp_emotstab,
      grp_pk
    )
  ) %>%
  filter(!is.na(value), value != "med") %>%
  group_by(name, value,fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    outcome_w1 ~ treatment
  ), data = .))) %>%
  filter_and_flip


trait_cates_w1_all_adj <-
  all_panels_long %>%
  pivot_longer(
    cols = c(
      grp_crt,
      grp_polint,
      grp_nfc,
      grp_openness,
      grp_conscientiousness,
      grp_extraversion,
      grp_agree,
      grp_emotstab,
      grp_pk
    )
  ) %>%
  filter(!is.na(value), value != "med") %>%
  group_by(name, value, fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w1 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip %>%
  mutate(type2 = term)
  

meta_trait_cates_w1_all_adj <-
  trait_cates_w1_all_adj %>% 
  group_by(name, value, type2) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) 


meta_trait_dic_w1_all_adj <-
  trait_cates_w1_all_adj %>% 
  group_by(name, type2) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, mods = value, data = .
  ), conf.int = TRUE)) %>%
  filter(term == "mods")


# Trait persistence

trait_cates_w2_p2_adj <-
  persistence_p2_df %>%
  pivot_longer(
    cols = c(
      grp_crt,
      grp_polint,
      grp_nfc,
      grp_openness,
      grp_conscientiousness,
      grp_extraversion,
      grp_agree,
      grp_emotstab,
      grp_pk
    )
  ) %>%
  filter(!is.na(value), value != "med") %>%
  group_by(name, value, fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w2 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip %>%
  mutate(type2 = term)



meta_trait_cates_w2_p2_adj <-
  trait_cates_w2_p2_adj  %>%
  group_by(name, value, type2) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) 

write_rds(trait_cates_w2_p2_adj, file = "fitted_models/trait_cates_w2_p2_adj.rds")
write_rds(meta_trait_cates_w2_p2_adj, file = "fitted_models/meta_trait_cates_w2_p2_adj.rds")


# w1 to w2 persistence ----------------------------------------------------


ates_w1_p2_noadj <-
  persistence_p2_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    outcome_w1 ~ treatment
  ), data = .))) %>%
  filter_and_flip

ates_w2_p2_noadj <-
  persistence_p2_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    outcome_w2 ~ treatment
  ), data = .))) %>%
  filter_and_flip

iv_p2_noadj <-
  persistence_p2_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(iv_robust(
    formula(outcome_w2 ~ outcome_w1 | treatment), data = .
  ))) %>% 
  filter(term == "outcome_w1")

ates_w1_p2_adj <-
  persistence_p2_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w1 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip

ates_w2_p2_adj <-
  persistence_p2_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w2 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip


iv_p2_adj <-
  persistence_p2_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(iv_robust(formula(
    paste0(
      "outcome_w2 ~ outcome_w1 +",
      covariates,
      "|  treatment +",
      covariates
    )
  )
  , data = .))) %>% 
  filter(term == "outcome_w1")

# w1 to w3 persistence

ates_w1_p3_noadj <-
  persistence_p3_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    outcome_w1 ~ treatment
  ), data = .))) %>%
  filter_and_flip

ates_w2_p3_noadj <-
  persistence_p3_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    outcome_w2 ~ treatment
  ), data = .))) %>%
  filter_and_flip

ates_w3_p3_noadj <-
  persistence_p3_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    outcome_w3 ~ treatment
  ), data = .))) %>%
  filter_and_flip

iv_p3_noadj <-
  persistence_p3_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(iv_robust(
    formula(outcome_w3 ~ outcome_w1 | treatment), data = .
  ))) %>% 
  filter(term == "outcome_w1")


ates_w1_p3_adj <-
  persistence_p3_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w3 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip

ates_w2_p3_adj <-
  persistence_p3_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w3 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip


ates_w3_p3_adj <-
  persistence_p3_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w2 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip


iv_p3_adj <-
  persistence_p3_df %>%
  group_by(fc, panel, panel_factor) %>%
  do(tidy(iv_robust(formula(
    paste0(
      "outcome_w2 ~ outcome_w1 +",
      covariates,
      "|  treatment +",
      covariates
    )
  )
  , data = .))) %>% 
  filter(term == "outcome_w1")


# removing race?
covariates <-
  "+ lucid_pid_7n +
  lucid_age +
  lucid_hhin +
  political_knowledge_pre +
  political_interest_pre +
  cognitive_reflection_pre +
  need_for_cognition_pre +
  extraversion_pre +
  agreeableness_pre +
  conscientiousness_pre +
  emotional_stability_pre +
  openness_to_experience_pre"



cates_w1_p2_adj <-
  persistence_p2_df %>%
  filter(lucid_pid_3 != "Independent") %>%
  group_by(fc, panel, panel_factor, lucid_pid_3) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w1 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip

cates_w2_p2_adj <-
  persistence_p2_df %>%
  filter(lucid_pid_3 != "Independent") %>%
  group_by(fc, panel, panel_factor, lucid_pid_3) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w2 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip


cates_w1_p3_adj <-
  persistence_p3_df %>%
  filter(lucid_pid_3 != "Independent") %>%
  group_by(fc, panel, panel_factor, lucid_pid_3) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w1 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip

cates_w2_p3_adj <-
  persistence_p3_df %>%
  filter(lucid_pid_3 != "Independent") %>%
  group_by(fc, panel, panel_factor, lucid_pid_3) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w2 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip

cates_w3_p3_adj <-
  persistence_p3_df %>%
  filter(lucid_pid_3 != "Independent") %>%
  group_by(fc, panel, panel_factor, lucid_pid_3) %>%
  do(tidy(lm_robust(formula(
    paste0("outcome_w3 ~ treatment +", covariates)
  ), data = .))) %>%
  filter_and_flip



meta_ates_w1_p2_adj <-
  ates_w1_p2_adj %>%
  left_join(treatments_df, by = c("fc", "panel")) %>%
  group_by(congeniality) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) %>%
  mutate(wave = 1,
         issues = "All Issues",
         lucid_pid_3 = "All Subjects")

meta_ates_w2_p2_adj <-
  ates_w2_p2_adj %>%
  left_join(treatments_df, by = c("fc", "panel")) %>%
  group_by(congeniality) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) %>%
  mutate(wave = 2,
         issues = "All Issues",
         lucid_pid_3 = "All Subjects")


meta_ates_w1_p3_adj <-
  ates_w1_p3_adj %>%
  left_join(treatments_df, by = c("fc", "panel")) %>%
  group_by(congeniality) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) %>%
  mutate(wave = 1, issues = "Issues across three waves", lucid_pid_3 = "All Subjects")

meta_ates_w2_p3_adj <-
  ates_w2_p3_adj %>%
  left_join(treatments_df, by = c("fc", "panel")) %>%
  group_by(congeniality) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) %>%
  mutate(wave = 2, issues = "Issues across three waves", lucid_pid_3 = "All Subjects")

meta_ates_w3_p3_adj <-
  ates_w3_p3_adj %>%
  left_join(treatments_df, by = c("fc", "panel")) %>%
  group_by(congeniality) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) %>%
  mutate(wave = 3, issues = "Issues across three waves", lucid_pid_3 = "All Subjects")


meta_cates_w1_p2_adj <-
  cates_w1_p2_adj %>%
  left_join(treatments_df, by = c("fc", "panel")) %>%
  group_by(lucid_pid_3, congeniality) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) %>%
  mutate(wave = 1, issues = "All Issues")

meta_cates_w2_p2_adj <-
  cates_w2_p2_adj %>%
  left_join(treatments_df, by = c("fc", "panel")) %>%
  group_by(lucid_pid_3, congeniality) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) %>%
  mutate(wave = 2, issues = "All Issues")


meta_cates_w1_p3_adj <-
  cates_w1_p3_adj %>%
  left_join(treatments_df, by = c("fc", "panel")) %>%
  group_by(lucid_pid_3, congeniality) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) %>%
  mutate(wave = 1, issues = "Issues across three waves")

meta_cates_w2_p3_adj <-
  cates_w2_p3_adj %>%
  left_join(treatments_df, by = c("fc", "panel")) %>%
  group_by(lucid_pid_3, congeniality) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) %>%
  mutate(wave = 2, issues = "Issues across three waves")

meta_cates_w3_p3_adj <-
  cates_w3_p3_adj %>%
  left_join(treatments_df, by = c("fc", "panel")) %>%
  group_by(lucid_pid_3, congeniality) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) %>%
  mutate(wave = 3, issues = "Issues across three waves")


persistence_meta <-
  bind_rows(
    meta_ates_w1_p2_adj,
    meta_ates_w2_p2_adj,
    meta_ates_w1_p3_adj,
    meta_ates_w2_p3_adj,
    meta_ates_w3_p3_adj,
    meta_cates_w1_p2_adj,
    meta_cates_w2_p2_adj,
    meta_cates_w1_p3_adj,
    meta_cates_w2_p3_adj,
    meta_cates_w3_p3_adj
  )

write_rds(persistence_meta, file = "fitted_models/persistence_meta.rds")


# Thermometers ----------------------------------------------

ft_long <- 
  all_panels_long %>%
  pivot_longer(cols = starts_with("w1_ft"), names_to = "target", values_to = "thermometer") %>% 
  filter(!is.na(thermometer))

ft_ates_w1_all_adj <-
  ft_long %>% 
  filter(
    !is.na(lucid_pid_3)
    ) %>% 
  group_by(fc, panel, panel_factor, target, lucid_pid_3) %>%
  do(tidy(lm_robust(formula(
    paste0("thermometer ~ treatment +", covariates_no_pid)
  ), data = .))) %>% 
  filter_and_flip


meta_ft_ates <- 
  ft_ates_w1_all_adj %>%
  rename(ty2 = term) %>% 
  group_by(lucid_pid_3, target, ty2) %>%
  do(tidy(rma.uni(
    yi = estimate, sei = std.error, data = .
  ), conf.int = TRUE)) 



# ft targets --------------------------------------------------------


ft_targets_long <- read_csv("data/ft_targets_long.csv")


fits <- list()
for(i in 1:nrow(ft_targets_long)) {
  if (!is.na(ft_targets_long$target_of_misinformation[i])) {
    dv <- ft_targets_long$target_of_misinformation[i]
    fc <- ft_targets_long$fc[i]
    topic_short_2 <- ft_targets_long$topic_short_2[i]
    
    
    formula <- formula(paste0("`", dv, "` ~ treatment +", covariates))
    fit <-
      lm_robust(
        formula = formula,
        data = filter(all_panels_long, fc == fc, topic_short_2 == topic_short_2)
      )
    
    fits[[i]] <-
      fit %>%
      tidy %>%
      mutate(dv = dv,
             fc = fc,
             topic_short_2 = topic_short_2) %>%
      filter_and_flip
  }
  
}



ft_targets_ates_w1_all_adj <- bind_rows(fits)


ft_targets_meta_w1_all_adj <- 
  ft_targets_ates_w1_all_adj %>% 
  mutate(term2 = term) %>% 
  group_by(term2) %>% 
  do(tidy(rma.uni(yi = estimate, sei = std.error, data = .), conf.int = TRUE)) %>% 
  mutate(term = term2, outcome = "META")

# by party

Dfits <- list()
Rfits <- list()
Ifits <- list()
for(i in 1:nrow(ft_targets_long)) {
  if (!is.na(ft_targets_long$target_of_misinformation[i])) {
    dv <- ft_targets_long$target_of_misinformation[i]
    fc <- ft_targets_long$fc[i]
    topic_short_2 <- ft_targets_long$topic_short_2[i]
    
    
    formula <- formula(paste0("`", dv, "` ~ treatment +", covariates_no_pid))
    Dfit <-
      lm_robust(
        formula = formula,
        data = filter(all_panels_long, fc == fc, topic_short_2 == topic_short_2, lucid_pid_3 == "Democrat")
      )
    
    Rfit <-
      lm_robust(
        formula = formula,
        data = filter(all_panels_long, fc == fc, topic_short_2 == topic_short_2, lucid_pid_3 == "Republican")
      )
    
    Ifit <-
      lm_robust(
        formula = formula,
        data = filter(all_panels_long, fc == fc, topic_short_2 == topic_short_2, lucid_pid_3 == "Independent")
      )
    
    Dfits[[i]] <-
      Dfit %>%
      tidy %>%
      mutate(dv = dv,
             fc = fc,
             topic_short_2 = topic_short_2,
             lucid_pid_3 = "Democrat") %>%
      filter_and_flip
    
    
    Rfits[[i]] <-
      Rfit %>%
      tidy %>%
      mutate(dv = dv,
             fc = fc,
             topic_short_2 = topic_short_2,
             lucid_pid_3 = "Republican") %>%
      filter_and_flip
    
    Ifits[[i]] <-
      Ifit %>%
      tidy %>%
      mutate(dv = dv,
             fc = fc,
             topic_short_2 = topic_short_2,
             lucid_pid_3 = "Independent") %>%
      filter_and_flip
    
  }
  
}

ft_targets_ates_w1_PID_adj <- bind_rows(Dfits, Rfits, Ifits)

ft_targets_meta_w1_PID_adj <- 
  ft_targets_ates_w1_PID_adj %>% 
  mutate(term2 = term) %>% 
  group_by(term2, lucid_pid_3) %>% 
  do(tidy(rma.uni(yi = estimate, sei = std.error, data = .), conf.int = TRUE)) %>% 
  mutate(term = term2, outcome = "META")



# save ------------------------------------------------------

write_rds(ates_w1_all_adj, file = "fitted_models/ates_w1_all_adj.rds")
write_rds(ates_w1_all_noadj, file = "fitted_models/ates_w1_all_noadj.rds")
write_rds(cates_w1_all_noadj, file = "fitted_models/cates_w1_all_noadj.rds")
write_rds(cates_w1_all_adj, file = "fitted_models/cates_w1_all_adj.rds")

write_rds(ates_w1_p2_noadj, file = "fitted_models/ates_w1_p2_noadj.rds")
write_rds(ates_w1_p2_adj, file = "fitted_models/ates_w1_p2_adj.rds")
write_rds(ates_w2_p2_noadj, file = "fitted_models/ates_w2_p2_noadj.rds")
write_rds(ates_w2_p2_adj, file = "fitted_models/ates_w2_p2_adj.rds")
write_rds(iv_p2_adj, file = "fitted_models/iv_p2_adj.rds")
write_rds(iv_p2_noadj, file = "fitted_models/iv_p2_noadj.rds")

write_rds(ates_w1_p3_noadj, file = "fitted_models/ates_w1_p3_noadj.rds")
write_rds(ates_w1_p3_adj, file = "fitted_models/ates_w1_p3_adj.rds")
write_rds(ates_w3_p3_noadj, file = "fitted_models/ates_w3_p3_noadj.rds")
write_rds(ates_w3_p3_adj, file = "fitted_models/ates_w3_p3_adj.rds")
write_rds(iv_p3_adj, file = "fitted_models/iv_p3_adj.rds")
write_rds(iv_p3_noadj, file = "fitted_models/iv_p3_noadj.rds")

write_rds(cates_w1_p2_adj, file = "fitted_models/cates_w1_p2_adj.rds")
write_rds(cates_w2_p2_adj, file = "fitted_models/cates_w2_p2_adj.rds")
write_rds(cates_w1_p3_adj, file = "fitted_models/cates_w1_p3_adj.rds")
write_rds(cates_w2_p3_adj, file = "fitted_models/cates_w2_p3_adj.rds")
write_rds(cates_w3_p3_adj, file = "fitted_models/cates_w3_p3_adj.rds")


write_rds(meta_trait_cates_w1_all_adj, file = "fitted_models/meta_trait_cates_w1_all_adj.rds")
write_rds(trait_cates_w1_all_adj, file = "fitted_models/trait_cates_w1_all_adj.rds")
write_rds(meta_trait_dic_w1_all_adj, file = "fitted_models/meta_trait_dic_w1_all_adj.rds")
write_rds(ft_ates_w1_all_adj, file = "fitted_models/ft_ates_w1_all_adj.rds")
write_rds(meta_ft_ates, file = "fitted_models/meta_ft_ates_w1_all_adj.rds")


write_rds(ft_targets_ates_w1_PID_adj, file = "fitted_models/ft_targets_ates_w1_PID_adj.rds")
write_rds(ft_targets_meta_w1_PID_adj, file = "fitted_models/ft_targets_meta_w1_PID_adj.rds")
write_rds(ft_targets_ates_w1_all_adj, file = "fitted_models/ft_targets_ates_w1_all_adj.rds")
write_rds(ft_targets_meta_w1_all_adj, file = "fitted_models/ft_targets_meta_w1_all_adj.rds")


